Skip to content

Add Kafka integration tests and deploy-kafka EaaS task#93

Open
lubomir wants to merge 1 commit into
mainfrom
overseer/84
Open

Add Kafka integration tests and deploy-kafka EaaS task#93
lubomir wants to merge 1 commit into
mainfrom
overseer/84

Conversation

@lubomir

@lubomir lubomir commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
  • Deploy single-node Apache Kafka broker (KRaft mode) in the EaaS ephemeral namespace before CTS starts, using emptyDir volumes to satisfy the restricted-v2 SCC on OpenShift.

  • Add a long-lived module-scoped kafka_consumer fixture that subscribes to all three CTS topics and acts as a cursor; an autouse drain check after every test ensures no message is silently left unconsumed.

  • Introduce CTSClient to pair an HTTP client with the Kafka consumer. Tag management methods (create_tag, add/remove_tagger/untagger) are members of CTSClient alongside the compose helpers, so every mutating action in tests uses a consistent interface.

  • Kafka assertions (compose-created, compose-tagged, compose-untagged) are embedded in CTSClient.import_compose, tag_compose, and untag_compose via _assert_compose_message; they activate only when KAFKA_URL is set so all tests continue to run without a broker.

  • Fix messaging.py: convert the string 'none' to None for compression_type so kafka-python selects no compression correctly.

  • Add kafka-python to test-requirements.txt; pass KAFKA_URL=kafka:9092 to pytest in the run-tests step.

@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.65%. Comparing base (e3ec3bc) to head (816fe06).

Files with missing lines Patch % Lines
cts/messaging.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
- Coverage   83.69%   83.65%   -0.04%     
==========================================
  Files          13       13              
  Lines        1325     1328       +3     
==========================================
+ Hits         1109     1111       +2     
- Misses        216      217       +1     
Flag Coverage Δ
unit-tests 83.65% <66.66%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Deploy single-node Apache Kafka broker (KRaft mode) in the EaaS
  ephemeral namespace before CTS starts, using emptyDir volumes to
  satisfy the restricted-v2 SCC on OpenShift.

- Add a long-lived module-scoped kafka_consumer fixture that subscribes
  to all three CTS topics and acts as a cursor; an autouse drain check
  after every test ensures no message is silently left unconsumed.

- Introduce CTSClient to pair an HTTP client with the Kafka consumer.
  Tag management methods (create_tag, add/remove_tagger/untagger) are
  members of CTSClient alongside the compose helpers, so every mutating
  action in tests uses a consistent interface.

- Kafka assertions (compose-created, compose-tagged, compose-untagged)
  are embedded in CTSClient.import_compose, tag_compose, and
  untag_compose via _assert_compose_message; they activate only when
  KAFKA_URL is set so all tests continue to run without a broker.

- Fix messaging.py: convert the string 'none' to None for
  compression_type so kafka-python selects no compression correctly.

- Add kafka-python to test-requirements.txt; pass KAFKA_URL=kafka:9092
  to pytest in the run-tests step.

Generated-By: OpenCode (google-vertex-anthropic/claude-sonnet-4-6@default)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants